# -*- codeing = utf-8 -*-
# @Time : 2021/2/20 11:04
# @Atuthor: 朱朱
# @File: 005字符串判断.py
# @Software: PyCharm
msg = '我是快乐的学习狗啊快乐的学习狗'
msg2 = '01234455789'
msg3 = '我这里也有数字123456'
msg4 = '我 这里 包含  空格 也有数字111111'
msg5 = ''
msg6 = ' '

"""
startswith      判断字符串是否以指定的内容开始
endswith        判断字符串是否以指定的内容结束
isalpha         判断字符串是事为纯字母
isdigit         判断字符串是否为纯数字
isalnum         判断字符串是否由数字和字母组成
isspace         判断字符串是否包含空格
"""

print(msg.startswith('我'))
print(msg2.startswith('我'))

print(msg.endswith('狗'))
print(msg2.endswith('狗'))

print(msg.isalpha())
print(msg2.isalpha())

print(msg2.isdigit())
print(msg3.isdigit())

print(msg2.isalnum())
print(msg3.isalnum())
print(msg4.isalnum())

print(msg5.isspace())
print(msg6.isspace())
